initFlyPath() {
    const result1 = []
    // 格式化路径
    const points = [
      [111.06307220458984, 20.680187225341797],
      [111.05282592773438, 20.66398048400879],
      [111.04964447021484, 20.683307647705078],
      [111.03298950195312, 20.66949462890625],
      [111.04936218261719, 20.676977157592773],
      [111.09184265136719, 20.729467391967773],
      [111.09219360351562, 20.73065757751465],
      [111.11849212646484, 20.81291389465332],
      [118.59721374511719, 31.941612243652344],
      [119.46292877197266, 32.2725830078125]
    ]

    for (let p = 0; p < points.length; p++) {
      const d = {
        fLongitude: points[p][0],
        fLatitude: points[p][1]
        // fHeight: points[p][2]
      }
      result1.push(d)
    }
    // 飞行
    this.typhoonFlytoPath(this.$earth.viewer, result1, 'http://127.0.0.1:8000/assets/plugin/yzsh/data/model/feiji.glb', '飞机')
  },
  typhoonFlytoPath(viewer, lujing, uri, name) {
    // 允许飞行动画
    viewer.clock.shouldAnimate = true

    // 设定模拟时间的界限
    const start = Cesium.JulianDate.fromDate(new Date())

    const stop = Cesium.JulianDate.addSeconds(start, lujing.length, new Cesium.JulianDate())

    viewer.clock.startTime = start.clone()
    viewer.clock.stopTime = stop.clone()
    viewer.clock.currentTime = start.clone()
    viewer.clock.clockRange = Cesium.ClockRange.LOOP_STOP // 末尾循环
    // 飞行速度，值越大速度越快，multiplier为0停止移动
    viewer.clock.multiplier = 1
    // viewer.timeline.zoomTo(start, stop);

    // 计算飞行时间和位置
    const property = this.computeFlight(start, lujing)

    let rotation = Cesium.Math.toRadians(30)

    function getRotationValue() {
      rotation += -0.03
      return rotation
    }
    const typhoonEntity = viewer.entities.add({
      name: '台风路径',
      availability: new Cesium.TimeIntervalCollection([
        new Cesium.TimeInterval({
          start: start,
          stop: stop
        })
      ]),
      position: property,
      orientation: new Cesium.VelocityOrientationProperty(property), // 根据位置移动自动计算方向
      model: {
        uri: '/data/model/Cesium_Air.glb',
        minimumPixelSize: 128,
        maximumScale: 20000,
        scale: 2.0
      },
      // point: {
      //      pixelSize: 10,
      //      color: Cesium.Color.TRANSPARENT,
      //      outlineColor: Cesium.Color.YELLOW,
      //      outlineWidth: 4
      // },
      // label: {
      //      text: name,
      //      font: '18px sans-serif',
      //      pixelOffset: new Cesium.Cartesian2(20, -100),
      // },
      path: {
        resolution: 1,
        material: new Cesium.PolylineGlowMaterialProperty({
          glowPower: 1,
          color: Cesium.Color.YELLOW
        }),
        width: 3
      }
    })
    // 设置插值函数为拉格朗日算法，平滑修改
    typhoonEntity.position.setInterpolationOptions({
      interpolationDegree: 10,
      interpolationAlgorithm: Cesium.LagrangePolynomialApproximation
    })
  },
  // 插值计算
  computeFlight(start, positions) {
    const property = new Cesium.SampledPositionProperty()
    for (let i = 0; i < positions.length; i++) {
      const time = Cesium.JulianDate.addSeconds(start, i, new Cesium.JulianDate())
      const position = Cesium.Cartesian3.fromDegrees(parseFloat(positions[i].fLongitude), parseFloat(positions[i].fLatitude), 1000)
      // const color = setcolor(positions[i].pow);
      const color = Cesium.Color.GREEN
      property.addSample(time, position)
      this.$earth.viewer.entities.add({
        name: positions[i].FID,
        infoBox: positions[i].pow,
        position: position,
        point: {
          pixelSize: 10,
          color: color
        }
      })
    }
    return property
  }